<?php
namespace StoreClient\Controller;
use Think\Image;

use Think\Page;

use Think\Controller;
class ScenicOrderController extends Controller {
	public function getOrder(){
		if(IS_POST){
			$order = D("ScenicOrder");
			$arr = $order->relation(true)->where($_POST)->find();
			if($arr){
				$json['result'] = true;
				$json['order'] = $arr;
			}else{
				$json['result'] = false;
			}
			$this->ajaxReturn($json);
		}else{
			$order = D("ScenicOrder");
			$arr = $order->relation(true)->where($_GET)->find();
			if($arr){
				$json['result'] = true;
				$json['order'] = $arr;
			}else{
				$json['result'] = false;
			}
			$this->ajaxReturn($json);
		}
	}
	public function confirmOrder() {
		if(IS_POST){
			$order = D("ScenicOrder");
			$data['type'] = 2;
			$arr = $order->where($_POST)->save($data);
			if($arr){
				$json['result'] = true;
			}else{
				$json['result'] = false;
			}
			$this->ajaxReturn($json);
		}
	}
}